package com.dpj.nio.c1;

import java.nio.ByteBuffer;

public class TestByteBufferAllocate {
    public static void main(String[] args) {
        System.out.println(ByteBuffer.allocate(16).getClass());
        System.out.println(ByteBuffer.allocateDirect(16));

        /**
         *   class java.nio.HeapByteBuffer  --java堆内存，读写效率较低，受到垃圾回收的影响
         *    java.nio.DirectByteBuffer[pos=0 lim=16 cap=16]  ---直接内存，读写效率较高(少一次拷贝 )，分配的效率低
         */

    }
}
